home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / telecomm / fnordadl / fn132src.zoo / cith / room.h < prev    next >
C/C++ Source or Header  |  1991-09-02  |  3KB  |  99 lines

  1. /*
  2.  * room.h -- structures and defines for Fnordadel rooms
  3.  *
  4.  * 91Apr29 AA    Extracted from ctdl.h and other places.
  5.  */
  6.  
  7. #ifndef _ROOM_H
  8. #define _ROOM_H
  9.  
  10. #define NUMMSGS        roomBuf.nummsgs    /* # of msgs in this room    */
  11.  
  12. #define MINMAXROOMS    3    /* Don't make this <3, or you will die */
  13. #define MAXMAXROOMS    999    /* The rest are our own whims */
  14. #define SANEMAXROOMS    64
  15.  
  16. /*
  17.  * special system rooms that will always be there.
  18.  */
  19. #define LOBBY        0    /* Lobby> is >always< room 0.        */
  20. #define MAILROOM    1    /* Mail>  is >always< room 1.        */
  21. #define AIDEROOM    2    /* Aide> is >always< room 2.        */
  22.  
  23. /*
  24.  * Room data
  25.  */
  26. #define MAXGEN           32    /* six bits of generation => 64 of them */
  27. #define FORGET_OFFSET  (MAXGEN / 2)    /* For forgetting rooms     */
  28.  
  29. /* Following #defines robbed from Hue, Jr.'s Cit-86 and then hacked on    */
  30. #define MSG_BULK    (NUMMSGS * sizeof (theMessages))
  31. #define RB_SIZE        (sizeof(roomBuf) - (PTR_SIZE))
  32.  
  33. struct rTable {         /* The summation of a room        */
  34.     unsigned short rtgen;    /* generation # of room         */
  35.     long flags;            /* public/private etc (see flags.h)    */
  36.     LABEL rtname;        /* name of room             */
  37.     long rtlastNet;        /* # of last net message in room    */
  38.     long rtlastLocal;        /* # of last @L message in room        */
  39.     long rtlastMessage;        /* # of most recent message in room    */
  40.     char rtfloorGen;        /* floor this room is in        */
  41. } ;
  42.  
  43. struct aRoom {            /* The appearance of a room:        */
  44.     unsigned short rbgen;    /* generation # of room         */
  45.     long     flags;        /* public/private etc (see flags.h)    */
  46.     char     rbfloorGen;    /* floor this room is in        */
  47.     LABEL    rbname;        /* name of room             */
  48.     long    rblastNet;
  49.     long    rblastLocal;
  50.     long    rblastMessage;
  51.     char    rbdirname[100];    /* user directory for this room's files */
  52.     unsigned short nummsgs;    /* # of msgs currently visible in room    */
  53.     theMessages *msg;
  54. } ;
  55.  
  56. /*
  57.  * room flags (formerly struct rflags)
  58.  */
  59. #define INUSE        0x0001L        /* Room in use?            */
  60. #define PUBLIC        0x0002L        /* Room public?            */
  61. #define ISDIR        0x0004L        /* Room directory?        */
  62. #define PERMROOM    0x0008L        /* Room permanent?        */
  63. #define SKIP        0x0010L        /* Room skipped? (temp for user)*/
  64. #define UPLOAD        0x0020L        /* Can room be uploaded to?    */
  65. #define DOWNLOAD    0x0040L        /* Can room be downloaded from?    */
  66. #define SHARED        0x0080L        /* Is this a shared room?    */
  67. #define ARCHIVE        0x0100L        /* Is this room archived?    */
  68. #define ANON        0x0200L        /* is this an anonymous room?    */
  69. #define INVITE        0x0400L        /* is this an invite-only room?    */
  70. #define NETDOWNLOAD    0x0800L        /* net-downloadable room?    */
  71. #define AUTONET        0x1000L        /* net all messages?        */
  72. #define READONLY    0x2000L        /* readonly room?        */
  73. #define DESCRIPTION    0x4000L        /* description on file?        */
  74.  
  75. #define initroomBuf(x)    (x)->msg = (theMessages *) xmalloc(0)
  76. #define killroomBuf(x)    if ((x)->msg) free((x)->msg)
  77.  
  78. #define USTKSIZ    16            /* allow up to 16 ungotos    */
  79.  
  80. struct Index {                /* save-list of room info */
  81.     int visited;            /* state of room */
  82. #define    iNEVER    0                /* not seen yet */
  83. #define    iGOTO    1                /* seen & goto'ed past */
  84. #define    iSKIP    2                /* seen & skipped past */
  85.     char lastgen;            /* geninfo about room at login */
  86. } ;
  87.  
  88. #define    l_OLD    0x0001        /* flag bits for listRoom()/listFloor()    */
  89. #define    l_NEW    0x0002
  90. #define    l_FGT    0x0004        /* list forgottten rooms        */
  91. #define l_EXCL    0x0008        /* don't list current room/floor    */
  92. #define    l_LONG    0x0010        /* long listing (for ;k...)        */
  93. #define    x_DIR    0x0020
  94. #define    x_NET    0x0040
  95. #define    x_PUB    0x0080
  96. #define    x_PRIV    0x0100
  97.  
  98. #endif
  99.